// pages/mypassword/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    originalpas:null, //原账号
    account:null, //账号
    password:null ,//密码
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },
  onoriginalpas(e){
    let that = this;
    let account = e.detail.value;
    that.setData({
      account
    })
  },
  onuserNameInput(e){
    let that = this;
    let originalpas = e.detail.value;
    that.setData({
      originalpas
    })
  },
  onpasWInput(e){
    let that = this;
    let password = e.detail.value;
    that.setData({
      password
    })
  },
  /**绑定账号密码**/
  onregistered(e){
    let that = this;
    let originalpas = that.data.originalpas;
    let account = that.data.account;
    let password = that.data.password;
    if(originalpas==null){
      wx.showToast({icon: 'none', title: '请输入原密码',duration: 2000 })
    }else if(account==null){
      wx.showToast({icon: 'none', title: '请输入新账号',duration: 2000 })
    }else if(password==null){
      wx.showToast({icon: 'none', title: '请输入新密码',duration: 2000 })
    }else { 
      wx.showToast({ title: '修改成功', icon: 'success', duration: 1500 })
      
    } 

  },

  /***/

  /*跳转账号页*/
  onexisting(e){
    wx.navigateTo({
      url: '../myaccount/myaccount',
    })
  },
  /*返回*/
  navigateBack() {
    wx.navigateBack({
      delta: 1
    })
  },
 


})